function loadImgs(cb) {
  const imgs = document.querySelectorAll('img')
  if (imgs.length === 0) {
    cb && cb()
    return
  }
  let loadedNum = 0
  for (let k = 0; k < imgs.length; k++) {
    const img = imgs[k]
    let newImg = new Image()
    // img.crossOrigin = 'anonymous'// 'use-credentials'
    newImg.src = img.src
    newImg.onload = (e) => {
      loadedNum++
      if (imgs.length === loadedNum) {
        cb && cb()
      }
    }
    newImg.error = (err) => {
      loadedNum++
      if (imgs.length === loadedNum) {
        cb && cb()
      }
    }
  }
}
